<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
赋值:<span th:text="${userName}">userName!</span><br>
拼接:<span th:text="'Hello'+${userName}+'!'">Hello userName!</span><br>
拼接:<span th:text="|Hello ${userName}! |">Hello userName!</span><br>
<div th:inline="text">
    <p>Hello,[[${userName}]]!</p>
    <br/>
</div>
<script th:inline="javascript">
    var msg='Hello'+[[${userName}]]
    alert(msg)
</script>

<h1>基本对象</h1>
<!--操作request对象-->
<p th:text="${#request.getAttribute('test')}"></p>
<!--操作request作用域，不能使用request.test操作-->
<p th:text="${test}"></p>
<!--操作Session作用域-->
<p th:text="${session.test}"></p>
<h1>Utility</h1>
<!--格式化时间-->
<p th:text="${#dates.format(date,'yyyy-MM-dd HH:mm:ss')}">2023-06-01</p>
<!--创建当前时间 精确到天-->
<p th:text="${#dates.createToday()}">2023-06-01</p>
<p th:text="${#dates.format(#dates.createToday(),'yyyy-MM-dd HH:mm:ss')}">2023-06-01</p>

</body>
</html>